<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<?php
     include_once('Configs/database.php');
     include_once('BoMon.php');
     include_once('NganhHoc.php');
     class Khoa extends database{
        
         private $makhoa;
         private $tenkhoa;
         //private $dsbm;
        // private $dsnganh;
         public function setMaKhoa($makhoa){
            $this->makhoa = $makhoa;
         }
         public function setTenKhoa($tenkhoa){
            $this->tenkhoa = $tenkhoa;
         }
         /*public function setDSBM(){
            $bm = new BoMon();
            $this->dsbm = $bm->dsBMTheoKhoa($this->getMaKhoa());
         }*/
         /*public function getDSBM(){
            return $this->dsbm;
         }*/
         public function getMaKhoa(){
            return $this->makhoa;
         }
         public function getTenKhoa(){
            
             return $this->tenkhoa;
         }
         public function thongTinKhoa(){
            $this->setQuery("select * from Khoa where makhoa='".$this->getMaKhoa()."'");
			return $this->fetchAll();
                        
         }
         /*public function setDSNganh(){
            $nganh = new NganhHoc();
            $this->dsnganh = $nganh->dsNganhTheoKhoa($this->makhoa);
         }
         public function getDSNganh(){
            return $this->dsnganh;
         }*/
         public function themKhoa(){                            
             $this->setQuery("insert into Khoa(makhoa,tenkhoa) values ('".$this->getMaKhoa()."','".$this->getTenKhoa()."')");
             
             return $this->executeQuery();
         }
         public function suaKhoa(){
            $this->setQuery("update Khoa set tenkhoa='".$this->getTenKhoa()."' where makhoa='".$this->getMaKhoa()."'");
            
            return $this->executeQuery();
         }
         public function xoaKhoa(){
            $this->setQuery("delete from Khoa where makhoa='".$this->getMaKhoa()."'");
            return $this->executeQuery();
         }
         public function dsBMCuaKhoa(){
            $this->setQuery("select * from BoMon where makhoa='".$this->getMaKhoa()."'");
            return $this->fetchAll();
         }
         public function dsNganhCuaKhoa(){
            $this->setQuery("select * from NganhHoc where makhoa='".$this->getMaKhoa()."'");
            return $this->fetchAll();
         }
         public function dsTatCaKhoa(){
            $this->setQuery("select * from Khoa order by makhoa");
            return $this->fetchAll();
         }
     }
    
?>
